/*******************************************************************************
 * @project: Java_Genericit
 * @package: com.burns.java.generic
 * @file: Test4.java
 * @author: Administrator
 * @created: 2017年5月16日
 * @purpose:
 * 
 * @version: 1.0
 * 
 * Revision History at the end of file.
 * 
 * Copyright 2017 AcconSys All rights reserved.
 ******************************************************************************/

package com.burns.java.generic;

public class Test4 {
	public static void main(String[] args) {
		Box<Number> name = new Box<Number>(99);
		Box<Integer> age = new Box<Integer>(712);

		getData(name);

		// The method getData(Box<Number>) in the type GenericTest is
		// not applicable for the arguments (Box<Integer>)
//		getData(age); // 1通过提示信息，我们知道Box<Number>在逻辑上不能视为Box<Integer>的父类
	}

	public static void getData(Box<Number> data) {
		System.out.println("data :" + data.getData());
	}
}

/*******************************************************************************
 * <B>Revision History</B><BR>
 * [type 'revision' and press Alt + / to insert revision block]<BR>
 * 
 * 
 * 
 * Copyright 2017 AcconSys All rights reserved.
 ******************************************************************************/